/**
 * Created by IntelliJ IDEA
 * author: 张道阳
 * date: 2019/3/21 14:19
 * description:管理员登录
 */
package cn.mengzhiyi.guimei.service.impl;

import cn.mengzhiyi.guimei.dao.LoginDao;
import cn.mengzhiyi.guimei.dao.impl.LoginDaoImpl;
import cn.mengzhiyi.guimei.pojo.SuperUser;
import cn.mengzhiyi.guimei.service.LoginService;

public class LoginServiceImpl implements LoginService {
    private LoginDao loginDao;
    public LoginServiceImpl() {
        loginDao=new LoginDaoImpl();
    }

    @Override
    public SuperUser login(SuperUser sup) {
        SuperUser supu=loginDao.login(sup);
        if (supu.getUserLoginName().equals(sup.getUserLoginName())&&supu.getUserPassword().equals(sup.getUserPassword())){
            return supu;
        }
        else {return null;}
    }

    @Override
    public SuperUser getSuperUserByID(int id) {
        return loginDao.getSuperUserByID(id);
    }

    @Override
    public int updateOther(SuperUser superUser) {
        return loginDao.updateOther(superUser);
    }

    @Override
    public int updatePwd(SuperUser superUser) {
        return 0;
    }
}
